﻿namespace QFramework.Fullstack
{
    public interface ICommandSystem
    {
        void SendCommand<T>() where T : ICommand, new();
        void SendCommand(ICommand command);
    }

    public class CommandSystem : ICommandSystem
    {
        public void SendCommand<T>() where T : ICommand, new()
        {
            new T().Execute();
        }

        public void SendCommand(ICommand command)
        {
            command.Execute();
        }
    }
}